package com.jackrain.nea.fc.dl.mapper;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

/**
 * 入库通知
 * Mapper
 *
 * @author xuxinshuai
 * @create 2018/05/12
 */
@Mapper
public interface WmsTranMapper {


    @Select("SELECT ID FROM DL_B_TRAN_ITEM_SKU WHERE DL_B_TRAN_ID =#{arg0} AND PS_C_SKU_ECODE=#{arg1}")
    Long selectTranId(Long arg0, String arg1);

    @Select("SELECT ID FROM DL_B_TRAN WHERE BILL_NO=#{billno} AND ISACTIVE='Y' AND STATUS='2' AND SEND_STATUS='1' ")
    Long selectTranoutBillnoId(String billno);

    @Select("SELECT ID FROM DL_B_TRAN WHERE SEND_STATUS='2' AND ACCEPTE_STATUS='1' AND BILL_NO=#{billno}  ")
    Long selectTraninBillnoId(String billno);

    @Select("SELECT PRICE_LIST FROM DL_B_TRAN_ITEM_SKU WHERE ID=#{itemId}")
    BigDecimal selectPriceList(Long itemId);

    @Select("SELECT QTY_OUT AS QTY_IN,ID FROM DL_B_TRAN_ITEM_SKU WHERE DL_B_TRAN_ID IN ( #{objid} )")
    List<HashMap> selectQtyId(Long objid);

    @Select("SELECT  TRAN_B_BILL_BOX_ID  FROM DL_B_TRAN WHERE ID = #{billid}")
    Long selectTraIdByTranInId(Long billid);

}
